<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML5 自适应页面</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: Arial, sans-serif;
            color: #333;
            line-height: 1.4;
        }
        .container {
            min-width: 980px;
            margin: auto;
            padding: 10px;
            max-width: 100%;
        }

        section {
            float: left;
            width: 100%;
            padding: 5px;
        }

        @media (min-width: 980px) {
            section {
                width: 100%;
                float: none;
            }
        }
        html,body,.container{
            height: 100%;
        }

        .gridMain{
            width: 96%;
            height: 100%;
            margin-left: 2%;
        }
        .gridItem{
            width: 46%;
            height: 46%;
            display: inline-block;
            margin-top: 1%;
            box-sizing: border-box;
            border: solid 1px #c8c8c8;
            border-radius: 10px;
        }
        .gridItem:nth-child(2n){
            margin-left: 2%;
        }
        .gridItem:nth-child(2n-1){
            margin-left: 3%;
        }
        .gridItem:nth-child(3),.gridItem:nth-child(4){
            margin-top: 2%;
        }
        .imageView{
            width: 62%;
            height: 65%;
            float: left;
            margin-left: 3%;
            margin-top: 2%;
        }
        .image{
            display: inline-block;
            width: 100%;
            height: 100%;
        }
        .action{
            width: 31%;
            margin-left: 1%;
            height: 65%;
            margin-top: 2%;
            display: inline-block;
            float: left;
        }

        .btn{
            width: 80%;
            height: 20%;
            margin-left: 10%;
            box-sizing: border-box;
            border: solid 1px #c8c8c8;
            border-radius: 10px;
            text-align: center;
            font-size: 18px;
            color: white;
            height: 48px;
            line-height: 48px;
            background: orange;
            cursor: pointer;
        }
        .btn:nth-child(2),.btn:nth-child(3){
            margin-top: 8%;
        }
        .stop{
            background: #CCCCCC;
        }
        .play{
            background: #27CE99;
        }
        .info{
            width: 94%;
            height: 30%;
            margin-left: 3%;
            display: inline-block;
            float: left;
            padding-top: 10px;
        }
        .line:nth-child(2){
            margin-top: 2%;
        }
        .item{
            display: inline-block;
            margin-left: 5%;
        }
        .item:nth-child(1){
            margin-left: 0px;
        }
        .number{
            display: inline-block;
            width: 20px;
            height: 20px;
            font-size: 17px;
            line-height: 20px;
            border-radius: 50%;
            background: black;
            color: white;
            font-weight: 700;
            text-align: center;
            padding: 0px;
        }
        /** 新增 **/
        .container{
            position: relative;
        }
        #startWindow{
            position: absolute;
            width: 48%;
            left: 26%;
            height: 40%;
            top:20%;
            box-sizing: border-box;
            border: solid 1px #88BBDD;
            background: white;
            z-index: 10;
            font-weight: 400;
            font-size: px;
            min-width: 640px;
            min-height: 400px;
        }
        #mask{
            width: 100%;
            height: 100%;
            position: absolute;
            background: #666666;
            opacity: 0.4;
            top:0px;
            left: 0px;
            z-index: 5;
        }
        #title{
            width: 92%;
            height: 48px;
            background: #ededed;
            text-align: center;
            line-height: 48px;
            float: left;
        }
        #close{
            width: 8%;
            background: red;
            height: 48px;
            line-height: 48px;
            color: white;
            float: left;
            text-align: center;
            font-size: 28px;
            cursor: pointer;
        }
        .form{
            width: 80%;
            height: 60%;
            margin-left: 10%;
            margin-top: 10%;
        }
        .row{
            height: 32px;
            width: 50%;
            margin-top: 20px;
            float: left;
        }
        .row:nth-child(3),.row:nth-child(4){
            width: 100%;
        }
        .textarea{
            width: 470px;
            resize: none;
            box-sizing: border-box;
            padding: 10px;
        }
        .text{
            margin-left: 10px;
            height: 32px;
            line-height: 32px;
        }
        .input{
            height: 30px;
            line-height: 30px;
            padding: 0px 5px;
        }

        #submit{
            margin-top: 60px;
            width: 50%;
            margin-left: 25%;
            background: #6787cc;
        }
    </style>
    <script type="text/javascript" src="/webjars/jquery/3.6.0/jquery.min.js" ></script>
</head>
<body>
<div class="container"  >
    <div class="gridMain" >
        <div class="gridItem" >
            <div class="imageView">
                <img class="image" th:src="@{/img/stop.jpg}">
            </div>
            <div class="action" >
                <div class="btn play" >
                    <span class="text" >开始游戏</span>
                </div>
                <div class="btn stop" >
                    <span class="text" >结束游戏</span>
                </div>
                <div class="btn light" >
                    <span class="text" >开灯</span>
                </div>
            </div>
            <div class="info" >
                <div class="line" >
                    <p class="item" >
                        <span> 桌号: </span>
                        <span class="number" > 1 </span>
                    </p>
                    <p class="item" >
                        <span> 状态: </span>
                        <span> 游戏中 </span>
                    </p>
                    <p class="item" >
                        <span> 单价: </span>
                        <span> 15￥ </span>
                    </p>
                    <p class="item" >
                        <span> 时长: </span>
                        <span> 2小时 </span>
                    </p>
                </div>
                <div class="line" >
                    <p class="item" >
                        <span> 开始时间: </span>
                        <span> 2024-12-01 19:00:00 </span>
                    </p>
                    <p class="item" >
                        <span> 结束时间: </span>
                        <span> 2024-12-01 21:00:00 </span>
                    </p>
                </div>
            </div>
        </div>
        <div class="gridItem" ></div>
        <div class="gridItem" ></div>
        <div class="gridItem" ></div>
    </div>
    <div id="mask" ></div>
    <div id="startWindow" >
        <div id="title" >
            <span> 开始游戏 </span>
        </div>
        <div id="close" >
            <span> X </span>
        </div>
        <div class="form" >
            <ul class="ul" >
                <div class="row" >
                        <span class="text" >
                            小时：
                        </span>
                    <input class="input" type="number" name="hour">
                    <span class="text" ></span>
                </div>
                <div class="row" >
                        <span class="text" >
                            分钟：
                        </span>
                    <input class="input" type="minute" name="hour">
                    <span class="text" ></span>
                </div>
                <div class="row full" >
                        <span class="text" >
                            玩家：
                        </span>
                    <textarea resize="none" rows="4" class="textarea" name="palyer" placeholder="请输入打球的人姓名"  ></textarea>
                    <span class="text" ></span>
                </div>
                <div class="row full" >
                    <div class="btn " id="submit" >
                        <span class="text" >开始游戏</span>
                    </div>
                </div>
            </ul>
        </div>
    </div>
</body>
<script type="text/javascript">
    $(function(){
        $(".play").click(function(e) {
            var image = $(this).parent('.action').siblings('.imageView').find('.image');
            image.attr('src','/img/open.png')
            $(this).css('background','#CCCCCC')
            $(this).siblings('.stop').css('background','#BB6666')
        })
        $(".stop").click(function(e) {
            var image = $(this).parent('.action').siblings('.imageView').find('.image');
            image.attr('src','/img/stop.jpg')
            $(this).css('background','#CCCCCC')
            $(this).siblings('.play').css('background','#27CE99')
        })
        $(".light").click(function(e) {
            $(this).css('background','#CCCCCC')
            var _this = $(this)
            setTimeout(function(){
                _this.css('background','orange')
            },100)
        })
    })
</script>
</html>